package com.zzz.cloud.thrift.provider;

import com.zzz.cloud.thrift.wrapper.ThriftServiceWrapper;

import java.util.ArrayList;
import java.util.List;

public class ServerInfoProvider {


    /**
     * 服务信息
     */
    private final List<ThriftServiceWrapper> list;
    /**
     * 服务绑定的端口
     */
    private final int port;

    public ServerInfoProvider(int port, List<ThriftServiceWrapper> list) {
        this.list = list;
        this.port = port;
    }

    public int getPort() {
        return port;
    }

    /**
     * 获取全部的服务
     *
     * @return
     */
    public List<ThriftServiceWrapper> getAllService() {
        if (list == null) {
            return new ArrayList<>();
        }
        return list;
    }

}
